<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@ taglib prefix="f" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

	<f:form action="${pageContext.request.contextPath }/admin/adduser" method="POST" modelAttribute="user">
		<c:if test="${user.id!=null }">id:<f:input path="id" />
			<br>
		</c:if>

account:<f:input path="account" />

		<c:if test="${user.id!=null }">
			<f:hidden path="id" />			
			<input type="hidden" name="_method" value="PUT" />
		</c:if>


		<br>
password:<f:password path="password" showPassword="true"   />
		<br>
name:<f:input path="name" />
		<f:errors path="name"></f:errors>
		<br>
email:<f:input path="email" />
		
		<br>
birthday:<f:input path="birthday" />
	
		<br>
		<%
		Map<String, String> sexMap = new HashMap();
				sexMap.put("0", "男");
				sexMap.put("1", "女");				
				request.setAttribute("sexmap", sexMap);
		%>

sex:<f:radiobuttons path="sex" items="${sexmap }" />
		<br>${user.account}
		<c:if test="${user.id!=null }">
注册IP：${user.ipCreated}
			<br>
最后登录ip：${user.ipLastActived}
			<br>
最后登录时间：${user.dateLastActived}			
			<br>
		</c:if>
		<input type="hidden" name="oldpwd" value="${user.password }" /><!-- 为了比较用户是否修改了密码  -->
		<input type="submit" value="保存 " />
	</f:form>


</body>
</html>